const { expressjwt: jwt } = require("express-jwt");
const { ROUTE_BASE_PATH } = process.env;

const { JWT_KEY } = process.env;
module.exports = ({
  unlessPath = ["/login", "/init"].map((el) => `${ROUTE_BASE_PATH}${el}`),
} = {}) => [
  jwt({ secret: JWT_KEY, algorithms: ["HS256"] }).unless({
    path: unlessPath,
  }),
];
